package work.jame.blog.mapper;

import org.apache.ibatis.annotations.Param;
import work.jame.blog.pojo.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import work.jame.blog.pojo.vo.PublishUserVO;
import work.jame.blog.pojo.vo.UserVO;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Jame
 * @since 2023-05-09
 */
public interface UserMapper extends BaseMapper<User> {

    /**
     * 获取发布文章的用户信息
     * @param publishUserId 发布文章的用户id
     * @param currentUserId 当前登录的用户id
     * @return PublishUserVO
     */
    PublishUserVO queryPublishUserInfo(@Param("publishUserId") Long publishUserId,
                                       @Param("currentUserId")Long  currentUserId);

    /**
     * 查询用户数据
     * @param userId  用户id
     * @return userVO
     */
    UserVO queryUserInfo(@Param("userId")Long userId);


    /**
     * 查询用户好友
     * 根据昵称模糊查询前8条数据
     * @param nickName
     * @param userId
     * @return
     */
    List<User>  fuzzyQueryByUserNickNameLimit8(@Param("nickName")String nickName,
                                               @Param("userId")Long userId);

}
